package org.standard.commons.utils;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * A class that encapsulate and provide pagination information. Such as page
 * number, size, count, total pages and data etc
 * 
 * @author Andy (latest modification by $Author: andy $)
 * @version $Revision: 1.2 $ $Date: 2006/08/28 08:53:23 $
 */
public class PageDivide {

	private String page;   // 当前页数 从1开始
	
	private int totalPageCount;  // 总页数

	private int  size; // 每页的显示记录数

	private int total; // 总记录数
	
	private int currentPage;
	
	private String flag;

	public PageDivide() {
		this.page="FIRST";
		this.totalPageCount=1;
		this.size=16;
		this.total=0;
		this.currentPage=1;
	}

	public int getTotalPageCount() {
		return totalPageCount;
	}

	public void setTotalPageCount(int totalPageCount) {
		if(totalPageCount==0){
			this.totalPageCount=0;
		}else if(totalPageCount%this.size==0){
		    this.totalPageCount = totalPageCount/this.size;
		}else{
			this.totalPageCount = totalPageCount/this.size+1;
		}
	}

	public int getSize() {
		return size;
	}

	public void setSize(int size) {
		this.size = size;
	}

	public String getPage() {
		return page;
	}

	public void setPage(String page) {
		this.page = page;
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public String getFlag() {
		return flag;
	}

	public void setFlag(String flag) {
		this.flag = flag;
	}



}
